#!python3
# Replace words by type into a sentence

sentenceFile = open('madlibs-sentence.txt')
sentence = sentenceFile.read()
sentenceFile.close()

words = sentence.split(' ')
for i in range(len(words)):
    word = words[i]
    if word.startswith('ADJECTIVE'):
        print('Enter an adjective:')
        words[i] = words[i].replace('ADJECTIVE', input())
    elif word.startswith('NOUN'):
        print('Enter a noun:')
        words[i] = words[i].replace('NOUN', input())
    elif word.startswith('ADVERB'):
        print('Enter an adverb:')
        words[i] = words[i].replace('ADVERB', input())
    elif word.startswith('VERB'):
        print('Enter a verb:')
        words[i] = words[i].replace('VERB', input())
        
print(' '.join(words))
